<header>
    <div class="header_container">
        <nav>
            <div class="logo" style="margin-left: 100px">
                <i class="fas fa-book-open"></i>
                <span>AI故事生成器</span>
                <link rel="stylesheet" href="/static/css/header.css">
            </div>
            {% if request.user.gategory == '管理员' %}
                <ul class="nav-links">
                    <li><a href="{% url 'store_system:story_review' %}">内容审核</a></li>
                    <li><a href="{% url 'store_system:user_control' %}">用户管理</a></li>
                    <li><a href="{% url 'store_system:user_feedback' %}">用户反馈</a></li>
                    <li><a href="{% url 'store_system:data_statistics' %}">数据统计</a></li>
                </ul>
                <div class="user-actions" style="margin-right: 100px">
                    {% if not request.user.is_authenticated %}
                        <button class="btn btn-login" onclick="location.href='{% url 'store_system:name_login' %}'">
                            登录
                        </button>
                        <button class="btn btn-signup" onclick="location.href='{% url 'store_system:register' %}'">注册
                        </button>
                    {% else %}
                        <div class="user-menu">
                            <div class="header_user-avatar" id="userAvatar">
                                hello! {{ request.user.username }}
                            </div>

                            <div class="dropdown-menu" id="dropdownMenu">
{#                                <a href="#" class="menu-item">#}
{#                                    <div class="menu-text" onclick="location.href='{% url 'store_system:personal_center' %}'">#}
{#                                        个人中心#}
{#                                    </div>#}
{#                                </a>#}

                                <a href="#" class="menu-item">
                                    <div class="menu-text" onclick="location.href='{% url 'store_system:change_password' %}'">修改密码</div>
                                </a>

                                <a href="#" class="menu-item logout">
                                    <div class="menu-text" onclick="location.href='{% url 'store_system:logout' %}'">
                                        退出登录
                                    </div>
                                </a>
                            </div>
                        </div>
                    {% endif %}
                </div>
            {% else %}
                <ul class="nav-links">
                    <li><a href="{% url 'store_system:index' %}">首页</a></li>
                    <li><a href="{% url 'store_system:generate_story' %}">生成故事</a></li>
                    <li><a href="{% url 'store_system:library' %}">故事库</a></li>
                    <li><a href="{% url 'store_system:community' %}">社区</a></li>
                    <li><a href="{% url 'store_system:about' %}">关于我们</a></li>
                </ul>
                <div class="user-actions" style="margin-right: 100px">
                    {% if not request.user.is_authenticated %}
                        <button class="btn btn-login" onclick="location.href='{% url 'store_system:login' %}'">
                            登录
                        </button>
                        <button class="btn btn-signup" onclick="location.href='{% url 'store_system:register' %}'">注册
                        </button>
                    {% else %}
                        <div class="user-menu">
                            <div class="user-avatar" id="userAvatar">
                                hello! {{ request.user.username }}
                            </div>

                            <div class="dropdown-menu" id="dropdownMenu">
                                <a href="#" class="menu-item">
                                    <div class="menu-text" onclick="location.href='{% url 'store_system:personal_center' %}'">
                                        个人中心
                                    </div>
                                </a>

                                <a href="#" class="menu-item">
                                    <div class="menu-text" onclick="location.href='{% url 'store_system:change_password' %}'">
                                        修改密码
                                    </div>
                                </a>

                                <a href="#" class="menu-item logout">
                                    <div class="menu-text" onclick="location.href='{% url 'store_system:logout' %}'">
                                        退出登录
                                    </div>
                                </a>
                            </div>
                        </div>
                    {% endif %}
                </div>
            {% endif %}
        </nav>
    </div>
</header>
